.class public abstract Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;
.super Ljava/lang/Object;
.source "NanoHTTPD.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$d;,
        Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$c;,
        Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$h;,
        Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$i;,
        Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$g;,
        Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$ResponseException;,
        Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Response;,
        Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$f;,
        Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$e;,
        Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$j;,
        Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$k;,
        Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$l;,
        Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$b;,
        Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Method;
    }
.end annotation


# instance fields
.field private final a:Ljava/lang/String;

.field private final b:I

.field private c:Ljava/net/ServerSocket;

.field private d:Ljava/util/Set;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Set<",
            "Ljava/net/Socket;",
            ">;"
        }
    .end annotation
.end field

.field private e:Ljava/lang/Thread;

.field private f:Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$b;

.field private g:Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$l;


# direct methods
.method public constructor <init>(I)V
    .locals 1

    const/4 v0, 0x0

    .line 1
    invoke-direct {p0, v0, p1}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;-><init>(Ljava/lang/String;I)V

    return-void
.end method

.method public constructor <init>(Ljava/lang/String;I)V
    .locals 1

    .line 2
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 3
    new-instance v0, Ljava/util/HashSet;

    invoke-direct {v0}, Ljava/util/HashSet;-><init>()V

    iput-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->d:Ljava/util/Set;

    .line 4
    iput-object p1, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->a:Ljava/lang/String;

    .line 5
    iput p2, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->b:I

    .line 6
    new-instance p1, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$g;

    const/4 p2, 0x0

    invoke-direct {p1, p0, p2}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$g;-><init>(Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$a;)V

    invoke-virtual {p0, p1}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->a(Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$l;)V

    .line 7
    new-instance p1, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$e;

    invoke-direct {p1}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$e;-><init>()V

    invoke-virtual {p0, p1}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->a(Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$b;)V

    return-void
.end method

.method static synthetic a(Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;)Ljava/net/ServerSocket;
    .locals 0

    .line 1
    iget-object p0, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->c:Ljava/net/ServerSocket;

    return-object p0
.end method

.method static synthetic a(Ljava/io/Closeable;)V
    .locals 0

    .line 2
    invoke-static {p0}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->b(Ljava/io/Closeable;)V

    return-void
.end method

.method private static final a(Ljava/net/ServerSocket;)V
    .locals 0

    if-eqz p0, :cond_0

    .line 3
    :try_start_0
    invoke-virtual {p0}, Ljava/net/ServerSocket;->close()V
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    :catch_0
    :cond_0
    return-void
.end method

.method static synthetic b(Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;)Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$l;
    .locals 0

    .line 1
    iget-object p0, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->g:Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$l;

    return-object p0
.end method

.method private static final b(Ljava/io/Closeable;)V
    .locals 0

    if-eqz p0, :cond_0

    .line 2
    :try_start_0
    invoke-interface {p0}, Ljava/io/Closeable;->close()V
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    :catch_0
    :cond_0
    return-void
.end method

.method static synthetic c(Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;)Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$b;
    .locals 0

    .line 2
    iget-object p0, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->f:Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$b;

    return-object p0
.end method

.method static synthetic c(Ljava/net/Socket;)V
    .locals 0

    .line 1
    invoke-static {p0}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->d(Ljava/net/Socket;)V

    return-void
.end method

.method private static final d(Ljava/net/Socket;)V
    .locals 0

    if-eqz p0, :cond_0

    .line 1
    :try_start_0
    invoke-virtual {p0}, Ljava/net/Socket;->close()V
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    :catch_0
    :cond_0
    return-void
.end method


# virtual methods
.method public abstract a(Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$i;)Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$Response;
.end method

.method protected a(Ljava/lang/String;)Ljava/lang/String;
    .locals 1

    :try_start_0
    const-string v0, "UTF8"

    .line 9
    invoke-static {p1, v0}, Ljava/net/URLDecoder;->decode(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object p1
    :try_end_0
    .catch Ljava/io/UnsupportedEncodingException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    const/4 p1, 0x0

    :goto_0
    return-object p1
.end method

.method public declared-synchronized a()V
    .locals 2

    monitor-enter p0

    .line 6
    :try_start_0
    iget-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->d:Ljava/util/Set;

    invoke-interface {v0}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v0

    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-eqz v1, :cond_0

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Ljava/net/Socket;

    .line 7
    invoke-static {v1}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->d(Ljava/net/Socket;)V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    goto :goto_0

    .line 8
    :cond_0
    monitor-exit p0

    return-void

    :catchall_0
    move-exception v0

    monitor-exit p0

    goto :goto_2

    :goto_1
    throw v0

    :goto_2
    goto :goto_1
.end method

.method public a(Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$b;)V
    .locals 0

    .line 10
    iput-object p1, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->f:Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$b;

    return-void
.end method

.method public a(Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$l;)V
    .locals 0

    .line 11
    iput-object p1, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->g:Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$l;

    return-void
.end method

.method public declared-synchronized a(Ljava/net/Socket;)V
    .locals 1

    monitor-enter p0

    .line 4
    :try_start_0
    iget-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->d:Ljava/util/Set;

    invoke-interface {v0, p1}, Ljava/util/Set;->add(Ljava/lang/Object;)Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 5
    monitor-exit p0

    return-void

    :catchall_0
    move-exception p1

    monitor-exit p0

    throw p1
.end method

.method public b()V
    .locals 4
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 3
    new-instance v0, Ljava/net/ServerSocket;

    invoke-direct {v0}, Ljava/net/ServerSocket;-><init>()V

    iput-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->c:Ljava/net/ServerSocket;

    .line 4
    iget-object v1, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->a:Ljava/lang/String;

    if-eqz v1, :cond_0

    new-instance v1, Ljava/net/InetSocketAddress;

    iget-object v2, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->a:Ljava/lang/String;

    iget v3, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->b:I

    invoke-direct {v1, v2, v3}, Ljava/net/InetSocketAddress;-><init>(Ljava/lang/String;I)V

    goto :goto_0

    :cond_0
    new-instance v1, Ljava/net/InetSocketAddress;

    iget v2, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->b:I

    invoke-direct {v1, v2}, Ljava/net/InetSocketAddress;-><init>(I)V

    :goto_0
    invoke-virtual {v0, v1}, Ljava/net/ServerSocket;->bind(Ljava/net/SocketAddress;)V

    .line 5
    new-instance v0, Ljava/lang/Thread;

    new-instance v1, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$a;

    invoke-direct {v1, p0}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD$a;-><init>(Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;)V

    invoke-direct {v0, v1}, Ljava/lang/Thread;-><init>(Ljava/lang/Runnable;)V

    iput-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->e:Ljava/lang/Thread;

    const/4 v1, 0x1

    .line 6
    invoke-virtual {v0, v1}, Ljava/lang/Thread;->setDaemon(Z)V

    .line 7
    iget-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->e:Ljava/lang/Thread;

    const-string v1, "NanoHttpd Main Listener"

    invoke-virtual {v0, v1}, Ljava/lang/Thread;->setName(Ljava/lang/String;)V

    .line 8
    iget-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->e:Ljava/lang/Thread;

    invoke-virtual {v0}, Ljava/lang/Thread;->start()V

    return-void
.end method

.method public declared-synchronized b(Ljava/net/Socket;)V
    .locals 1

    monitor-enter p0

    .line 9
    :try_start_0
    iget-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->d:Ljava/util/Set;

    invoke-interface {v0, p1}, Ljava/util/Set;->remove(Ljava/lang/Object;)Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 10
    monitor-exit p0

    return-void

    :catchall_0
    move-exception p1

    monitor-exit p0

    throw p1
.end method

.method public c()V
    .locals 1

    .line 3
    :try_start_0
    iget-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->c:Ljava/net/ServerSocket;

    invoke-static {v0}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->a(Ljava/net/ServerSocket;)V

    .line 4
    invoke-virtual {p0}, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->a()V

    .line 5
    iget-object v0, p0, Lcom/estrongs/android/pop/app/filetransfer/server/NanoHTTPD;->e:Ljava/lang/Thread;

    invoke-virtual {v0}, Ljava/lang/Thread;->join()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    .line 6
    invoke-virtual {v0}, Ljava/lang/Exception;->printStackTrace()V

    :goto_0
    return-void
.end method
